This release note gives a brief description of how the sample graphics applications work, and a few tips about re-building the samples.
The files contained in this folder are sample applications which demonstrate some of the uses and capabilities of the QuickDraw GX graphics system. All of the samples included are designed to be compiled under Think C 7.0.6 (or later) or MPW v3.4 (or later) using the universal interfaces 2.1. Think C v7.0.6 "Project" files are included for each sample application. For the projects files to compile properly, you'll need to drag the "QuickDraw™ GX Libraries" and "QuickDraw™ GX Interfaces" folders into the Think v7.x "projects" folder (or distribute their files appropriately).
If you have installed the "GXGraphics (debug)" extension to enable the extensive QuickDraw GX error handling capabilities, at times, you might find yourself in the debugger, with a "GRAPHICS NOTICE:_____". If this occurs, the GX system is telling you that the application is performing a task which might be avoided. You can continue past these debugger warnings (use "G" in MacsBug). By the way, you will only receive a notice if you are running the "debugging" version of the QuickDraw GX init.
Brief Descriptions:
• 3 Circles (hit testing)
This sample demonstrates the hit testing capabilities of the QuickDraw GX system. The app draws 3 circles. A user can select a circle and drag it around. An off-screen bitmap is used to redraw the windows contents. Each circle uses a transfer mode to provide color mixing as the users over laps each circle.
• All Shapes
This sample creates all of the GX graphics primitive shapes.
• Bitmap Shape with Clip
This application retrieves a bitmap shape from it's resource fork and applies a text shape clip to the bitmap shape.
• Bouncing Bitmap
This sample demonstrates the capabilities of the graphics system to manipulate and draw bitmaps. Each time the bitmap is drawn, it location's will change, and the object will be rotated. If the object hits the edge of the window, it will bounce back.
• Caps Attached To a Curve
We create a curve and attach a cap to each end.
• Dashing Text
Dashes a line of text along a curve.
• Getting Started w/QD GX
This application was used during the "Getting Started With QuickDraw GX" WWDC '93 session.
• GXOffscreens, GWorlds, Movies
This application uses the QuickDraw GX offscreen library, QuickDraw's GWorlds, and QuickTime v1.6 to play a QuickTime movie and rotate it with QuickDraw GX.
• Grayscale Bitmap
We create a 1 pixel high by 256 pixel bitmap and assign a gray value to each pixel. We will the use ScaleShape to scale the bitmap shape by 40 in the y direction.
• House Picture
This sample demonstrates the picture creation capabilities of the graphics system. We create a picture of a house by adding 7 different shapes to the picture. Each shape has a different size, color, and style.
• Mode
This sample allows you to change the transfer mode that is used to draw the text on top of a colored background. It will also allow you to set the color and type of updating used by the application. NOTE: On occasion, pixels may remain on the screen from the spinning text. This reflects the pre-alpha state.
• Offscreen Animation
Uses the QuickDraw GX offscreen library to simulate rectangles flying through space.
• One Rectangle
Creates a black rectangle.
• Paths & Frames
This sample demonstrates the framing capabilities of the graphics system. We create a shape containing a letter, rectangle, and a oval. We will then draw the shape in a different colors and frames.
• Patterned Curve
We create a "thick" curve and fill it with a star pattern.
• Pen Play
Creates various paths, and adjusts the pen size and location (i.e. the pen placed: on, inset, and outside of the geometry of the shape).
• Perspective Bitmap
This sample application retrieves a pixmap and converts it to a shape. We will then run the shape through a transform which will skew it, when drawn.
• QDGX Debugging (WWDC'94)
this application creates a picture containing 5 shapes (2 text shapes, 2 paths, and a rectangle). This is the same code used during the "Using QuickDraw GX in QuickDraw Applications & Debugging Tips" WWDC '94 session.
• Rotating Rects
This sample application will create a rectangle the size of the window. It will then rotate, scale, and color the rectangle before re-drawing it. The color is derived from the hsv color space.
• ShapePart Browser
This application displays several types of shapes with various features. Beside these are series of check boxes corresponding to all the shape parts recognized by the routine HitTestShape. As the cursor is positioned over each shape the parts hit-tested by the given point are highlighted on the corresponding check boxes. Unchecking a check box keeps the shape part from being tested. Since the glyph (and text) shape cannot have an edge, join, start or end cap these bits of the shape part field are interpreted differently by the graphics system to mean glyph bounds, glyph first, glyph last and side bearings instead. The Metrics menu allows the shape's bounding boxes (command-B) and control points (command-P) to be shown. The cursor may be moved automatically (command-M) until the mouse is moved again by the user.
• Spectacle
This sample application demonstrates the capabilities of viewPorts. The app creates a viewPort grid, each viewPort contains a different dither, halftone, or scaling.
• Spinning Colored Ovals
This sample creates an oval slightly smaller than the window. We will then rotate and color each oval. The oval is drawn twice. Once for the outside oval, and the second time to fill the inside oval. The oval is colored in an hsv color.
• Spinning Text
This sample application will create a string of text and rotate it, and color it with an hsv color.
• TestCubics
This sample converts a cubic Bezier to a quadratic Bezier using the "Cubic Library". Click on three locations within the window to define the points which represent the curve. You have the ability to set the amount of error and the number of points used for the conversion via the menus.
• Text To Outlines
Creates a text shapes and converts it to a path shape. The path shape will then contain the outlines of each character of the original string we had created.
• viewPort Mania
This sample demonstrates the multiple viewPort capabilities of the new graphics system. We create 6 child viewPorts and attach them to the parent viewPort of the window. We will then change the attributes of each viewPort, which allows the shape to be drawn to the particular viewPort in a different color space, scale, or halftone. We will then draw the same shape simultaneously to all of the viewPorts.